package com.jvtd.eyl.di.module;


import com.jvtd.eyl.data.AppDbManager;
import com.jvtd.eyl.data.DbManager;
import com.jvtd.eyl.data.api.ApiHelper;
import com.jvtd.eyl.data.api.AppApiHelper;
import com.jvtd.eyl.data.db.AppDbHelper;
import com.jvtd.eyl.data.db.DbHelper;
import com.jvtd.eyl.data.sp.AppPreferences;
import com.jvtd.eyl.data.sp.PreferencesHelper;
import com.jvtd.eyl.di.PreferenceInfo;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

/**
 * Created by Administrator on 207/10/16.
 * application
 */
@Module
public class ApplicationModule
{
  private static final String KEY_PREFERENCE = "PREFERENCE";

  @Provides
  @PreferenceInfo
  String providePreferenceName()
  {
    return KEY_PREFERENCE;
  }

  @Provides
  @Singleton
  DbManager provideDbManager(AppDbManager dbManager)
  {
    return dbManager;
  }

  @Provides
  @Singleton
  DbHelper provideDbHelper(AppDbHelper dbHelper)
  {
    return dbHelper;
  }

  @Provides
  @Singleton
  ApiHelper provideApiHelper(AppApiHelper apiHelper)
  {
    return apiHelper;
  }

  @Provides
  @Singleton
  PreferencesHelper providePreferenceHelper(AppPreferences appPreferences)
  {
    return appPreferences;
  }

}
